﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms; 
using CourseArraging.Frm.jcxx;
using CourseArraging.UControl; 
using CourseArraging.Common;
using System.Drawing;
using CourseArraging.Frm.xygl;
using CourseArraging.Frm.jygl;
using Stone.Library.Common;
using Stone.DataContracts;

namespace CourseArraging.Frm.jxgl
{
    /// <summary>
    /// 版权所有
    /// 石世特@温州医学院 sst330381@gmail.com
    /// </summary> 
    public class FrmQdxy : FrmToolbarBase
    {
        #region Fields
        private IContainer components = null;
        private DateTimePicker dateTimePicker_js;
        private DateTimePicker dateTimePicker_ks;
        private DepEntity depEntity;
        private FrmDepitem frmdepitem;
        private FrmStuItem frmstuintem;
        private FrmTecItem frmtecitem;
        private GroupBox groupBox_jsfs;
        private GroupBox groupBox1;
        private GroupBox groupBox2;
        private GroupBox groupBox3;
        public static FrmQdxy instance;
        private Label label_jydh;
        private Label label_jydq;
        private Label label_jynj;
        private Label label_jyxm;
        private Label label_jyzy;
        private Label label_xydh;
        private Label label_xydz;
        private Label label_xyfx;
        private Label label_xylxr;
        private Label label_xyxm;
        private Label label1;
        private Label label10;
        private Label label11;
        private Label label12;
        private Label label13;
        private Label label14;
        private Label label15;
        private Label label16;
        private Label label17;
        private Label label18;
        private Label label19;
        private Label label2;
        private Label label20;
        private Label label21;
        private Label label22;
        private Label label23;
        private Label label24;
        private Label label25;
        private Label label3;
        private Label label4;
        private Label label5;
        private Label label6;
        private Label label7;
        private Label label8;
        private Label label9;
        private RadioButton rbtn_ks;
        private RadioButton rbtn_t;
        private RadioButton rbtn_y;
        private StuEntity stuEntity;
        private TecEntity tecEntity;
        private RichTextBox txt_bz;
        public TextBox txt_fzmxs;
        public TextBox txt_jyno;
        public TextBox txt_km;
        public TextBox txt_skdd;
        public TextBox txt_xyno;
        public TextBox txt_ymks;
        public TextBox txt_zks;
        public TextBox txt_zwh;
        private UCkcb uCkcb1;
        private XyService.XyServiceClient xydao = new XyService.XyServiceClient();
        #endregion

        // Methods
        public FrmQdxy()
        {
            this.InitializeComponent();
            this.txt_xyno.Click += new EventHandler(this.txt_xyno_Click);
            this.txt_jyno.Click += new EventHandler(this.txt_jyno_Click);
            this.txt_skdd.Click += new EventHandler(this.txt_skdd_Click);
            this.txt_xyno.KeyPress += new KeyPressEventHandler(this.txt_xyno_KeyPress);
            this.txt_jyno.KeyPress += new KeyPressEventHandler(this.txt_jyno_KeyPress);
        }

        public override bool be4save()
        {
            if (this.label_xyxm.Text == string.Empty)
            {
                MessageBox.Show("请输入学员信息!");
                return false;
            }
            if (this.label_jyxm.Text == string.Empty)
            {
                MessageBox.Show("请输入教员信息!");
                return false;
            }
            if (this.uCkcb1.course_time_string.Count == 0)
            {
                MessageBox.Show("请输入课程时间安排信息!");
                return false;
            }
            if (this.txt_skdd.Text == string.Empty)
            {
                MessageBox.Show("请输入上课地点信息!");
                return false;
            }
            if (this.txt_km.Text == string.Empty)
            {
                MessageBox.Show("请输入科目信息!");
                return false;
            }
            if (this.dateTimePicker_ks.Value > this.dateTimePicker_js.Value)
            {
                MessageBox.Show("开始日期小于结束日期!");
                return false;
            }
            if (this.txt_zks.Text == string.Empty)
            {
                MessageBox.Show("请输入总课时!");
                return false;
            }
            if (this.txt_zwh.Text == string.Empty)
            {
                MessageBox.Show("请输入座位号!");
                return false;
            }
            if ((this.txt_ymks.Text == string.Empty) || (this.txt_fzmxs.Text == string.Empty))
            {
                MessageBox.Show("请输入费用信息!");
                return false;
            }
            return true;
        }

        public XyEntity CollectData()
        {
            XyEntity entity = new XyEntity();
            entity.qdxy_xybh = this.txt_xyno.Text;
            entity.qdxy_jybh = this.txt_jyno.Text;
            entity.qdxy_kcsj = CommonHelper.string2string2DB(this.uCkcb1.course_time_string);
            entity.qdxy_skdd = this.txt_skdd.Text;
            entity.qdxy_fzmks = entity.qdxy_ymks = this.txt_ymks.Text;
            if (this.rbtn_ks.Checked)
            {
                entity.qdxy_jsfs = "课时";
            }
            else if (this.rbtn_t.Checked)
            {
                entity.qdxy_jsfs = "天";
            }
            else
            {
                entity.qdxy_jsfs = "月";
            }
            entity.qdxy_ksrq = this.dateTimePicker_ks.Text;
            entity.qdxy_jsrq = this.dateTimePicker_js.Text;
            entity.qdxy_bz = this.txt_bz.Text;
            entity.qdxy_zwh = this.txt_zwh.Text;
            entity.qdxy_zks = this.txt_zks.Text;
            entity.qdxy_km = this.txt_km.Text;
            entity.qdxy_busy_simple = CommonHelper.string2string2DB(uCkcb1.course_time_int);
            return entity;
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void frmdepitem_selectedOK(object entity)
        {
            if (entity != null)
            {
                this.depEntity = (DepEntity)entity;
                this.txt_skdd.Text = this.depEntity.dep_info_address;
            }
        }

        private void frmstuintem_selectedOK(object entity)
        {
            if (entity != null)
            {
                this.stuEntity = (StuEntity)entity;
                this.txt_xyno.Text = this.stuEntity.user_no;
                this.label_xyxm.Text = this.stuEntity.user_name;
                this.label_xydh.Text = this.stuEntity.user_gddh;
                this.label_xydz.Text = this.stuEntity.user_address;
                this.label_xylxr.Text = this.stuEntity.user_lxr;
                this.label_xyfx.Text = this.stuEntity.user_depname;
            }
        }

        private void frmtecitem_selectedOK(object entity)
        {
            this.tecEntity = (TecEntity)entity;
            this.txt_jyno.Text = this.tecEntity.user_no;
            this.label_jyxm.Text = this.tecEntity.user_name;
            this.label_jyzy.Text = this.tecEntity.user_course;
            this.label_jydh.Text = this.tecEntity.user_gddh;
            this.label_jynj.Text = this.tecEntity.user_grade;
            this.label_jydq.Text = this.tecEntity.user_depname;
        }

        public static FrmQdxy GetInstance()
        {
            if ((instance == null) || instance.IsDisposed)
            {
                instance = new FrmQdxy();
                instance.MdiParent = GlobalVar.frmMain;
            }
            instance.BringToFront();
            return instance;
        }

        private void InitializeComponent()
        {
            this.label2 = new System.Windows.Forms.Label();
            this.label1 = new System.Windows.Forms.Label();
            this.txt_xyno = new System.Windows.Forms.TextBox();
            this.txt_jyno = new System.Windows.Forms.TextBox();
            this.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label_xyfx = new System.Windows.Forms.Label();
            this.label_xylxr = new System.Windows.Forms.Label();
            this.label_xydz = new System.Windows.Forms.Label();
            this.label_xydh = new System.Windows.Forms.Label();
            this.label_xyxm = new System.Windows.Forms.Label();
            this.label7 = new System.Windows.Forms.Label();
            this.label6 = new System.Windows.Forms.Label();
            this.label5 = new System.Windows.Forms.Label();
            this.label4 = new System.Windows.Forms.Label();
            this.label3 = new System.Windows.Forms.Label();
            this.label10 = new System.Windows.Forms.Label();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.label_jydq = new System.Windows.Forms.Label();
            this.label_jynj = new System.Windows.Forms.Label();
            this.label_jydh = new System.Windows.Forms.Label();
            this.label_jyzy = new System.Windows.Forms.Label();
            this.label_jyxm = new System.Windows.Forms.Label();
            this.label8 = new System.Windows.Forms.Label();
            this.label9 = new System.Windows.Forms.Label();
            this.label11 = new System.Windows.Forms.Label();
            this.label12 = new System.Windows.Forms.Label();
            this.label13 = new System.Windows.Forms.Label();
            this.groupBox3 = new System.Windows.Forms.GroupBox();
            this.uCkcb1 = new CourseArraging.UControl.UCkcb();
            this.label14 = new System.Windows.Forms.Label();
            this.label15 = new System.Windows.Forms.Label();
            this.label16 = new System.Windows.Forms.Label();
            this.label17 = new System.Windows.Forms.Label();
            this.label18 = new System.Windows.Forms.Label();
            this.label19 = new System.Windows.Forms.Label();
            this.txt_bz = new System.Windows.Forms.RichTextBox();
            this.dateTimePicker_ks = new System.Windows.Forms.DateTimePicker();
            this.dateTimePicker_js = new System.Windows.Forms.DateTimePicker();
            this.txt_skdd = new System.Windows.Forms.TextBox();
            this.txt_ymks = new System.Windows.Forms.TextBox();
            this.label20 = new System.Windows.Forms.Label();
            this.groupBox_jsfs = new System.Windows.Forms.GroupBox();
            this.rbtn_y = new System.Windows.Forms.RadioButton();
            this.rbtn_t = new System.Windows.Forms.RadioButton();
            this.rbtn_ks = new System.Windows.Forms.RadioButton();
            this.label21 = new System.Windows.Forms.Label();
            this.txt_zks = new System.Windows.Forms.TextBox();
            this.txt_zwh = new System.Windows.Forms.TextBox();
            this.label24 = new System.Windows.Forms.Label();
            this.label25 = new System.Windows.Forms.Label();
            this.label22 = new System.Windows.Forms.Label();
            this.txt_fzmxs = new System.Windows.Forms.TextBox();
            this.label23 = new System.Windows.Forms.Label();
            this.txt_km = new System.Windows.Forms.TextBox();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.groupBox3.SuspendLayout();
            this.groupBox_jsfs.SuspendLayout();
            this.SuspendLayout();
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label2.ForeColor = System.Drawing.Color.Black;
            this.label2.Location = new System.Drawing.Point(21, 91);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(95, 17);
            this.label2.TabIndex = 5;
            this.label2.Text = "请输入学员编号:";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label1.ForeColor = System.Drawing.Color.Black;
            this.label1.Location = new System.Drawing.Point(614, 94);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(95, 17);
            this.label1.TabIndex = 6;
            this.label1.Text = "请输入教员编号:";
            // 
            // txt_xyno
            // 
            this.txt_xyno.Location = new System.Drawing.Point(122, 90);
            this.txt_xyno.Name = "txt_xyno";
            this.txt_xyno.Size = new System.Drawing.Size(160, 21);
            this.txt_xyno.TabIndex = 0;
            // 
            // txt_jyno
            // 
            this.txt_jyno.Location = new System.Drawing.Point(715, 92);
            this.txt_jyno.Name = "txt_jyno";
            this.txt_jyno.Size = new System.Drawing.Size(160, 21);
            this.txt_jyno.TabIndex = 1;
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label_xyfx);
            this.groupBox1.Controls.Add(this.label_xylxr);
            this.groupBox1.Controls.Add(this.label_xydz);
            this.groupBox1.Controls.Add(this.label_xydh);
            this.groupBox1.Controls.Add(this.label_xyxm);
            this.groupBox1.Controls.Add(this.label7);
            this.groupBox1.Controls.Add(this.label6);
            this.groupBox1.Controls.Add(this.label5);
            this.groupBox1.Controls.Add(this.label4);
            this.groupBox1.Controls.Add(this.label3);
            this.groupBox1.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.groupBox1.Location = new System.Drawing.Point(24, 117);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(536, 111);
            this.groupBox1.TabIndex = 9;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "学员信息";
            // 
            // label_xyfx
            // 
            this.label_xyfx.AutoSize = true;
            this.label_xyfx.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_xyfx.ForeColor = System.Drawing.Color.Black;
            this.label_xyfx.Location = new System.Drawing.Point(315, 54);
            this.label_xyfx.Name = "label_xyfx";
            this.label_xyfx.Size = new System.Drawing.Size(0, 17);
            this.label_xyfx.TabIndex = 15;
            // 
            // label_xylxr
            // 
            this.label_xylxr.AutoSize = true;
            this.label_xylxr.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_xylxr.ForeColor = System.Drawing.Color.Black;
            this.label_xylxr.Location = new System.Drawing.Point(315, 25);
            this.label_xylxr.Name = "label_xylxr";
            this.label_xylxr.Size = new System.Drawing.Size(0, 17);
            this.label_xylxr.TabIndex = 14;
            // 
            // label_xydz
            // 
            this.label_xydz.AutoSize = true;
            this.label_xydz.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_xydz.ForeColor = System.Drawing.Color.Black;
            this.label_xydz.Location = new System.Drawing.Point(66, 84);
            this.label_xydz.Name = "label_xydz";
            this.label_xydz.Size = new System.Drawing.Size(0, 17);
            this.label_xydz.TabIndex = 13;
            // 
            // label_xydh
            // 
            this.label_xydh.AutoSize = true;
            this.label_xydh.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_xydh.ForeColor = System.Drawing.Color.Black;
            this.label_xydh.Location = new System.Drawing.Point(66, 54);
            this.label_xydh.Name = "label_xydh";
            this.label_xydh.Size = new System.Drawing.Size(0, 17);
            this.label_xydh.TabIndex = 12;
            // 
            // label_xyxm
            // 
            this.label_xyxm.AutoSize = true;
            this.label_xyxm.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_xyxm.ForeColor = System.Drawing.Color.Black;
            this.label_xyxm.Location = new System.Drawing.Point(66, 25);
            this.label_xyxm.Name = "label_xyxm";
            this.label_xyxm.Size = new System.Drawing.Size(0, 17);
            this.label_xyxm.TabIndex = 11;
            // 
            // label7
            // 
            this.label7.AutoSize = true;
            this.label7.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label7.ForeColor = System.Drawing.Color.Black;
            this.label7.Location = new System.Drawing.Point(255, 54);
            this.label7.Name = "label7";
            this.label7.Size = new System.Drawing.Size(59, 17);
            this.label7.TabIndex = 10;
            this.label7.Text = "所在区域:";
            // 
            // label6
            // 
            this.label6.AutoSize = true;
            this.label6.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label6.ForeColor = System.Drawing.Color.Black;
            this.label6.Location = new System.Drawing.Point(255, 25);
            this.label6.Name = "label6";
            this.label6.Size = new System.Drawing.Size(47, 17);
            this.label6.TabIndex = 9;
            this.label6.Text = "联系人:";
            // 
            // label5
            // 
            this.label5.AutoSize = true;
            this.label5.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label5.ForeColor = System.Drawing.Color.Black;
            this.label5.Location = new System.Drawing.Point(6, 84);
            this.label5.Name = "label5";
            this.label5.Size = new System.Drawing.Size(59, 17);
            this.label5.TabIndex = 8;
            this.label5.Text = "联系地址:";
            // 
            // label4
            // 
            this.label4.AutoSize = true;
            this.label4.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label4.ForeColor = System.Drawing.Color.Black;
            this.label4.Location = new System.Drawing.Point(6, 54);
            this.label4.Name = "label4";
            this.label4.Size = new System.Drawing.Size(59, 17);
            this.label4.TabIndex = 7;
            this.label4.Text = "联系电话:";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label3.ForeColor = System.Drawing.Color.Black;
            this.label3.Location = new System.Drawing.Point(6, 25);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(59, 17);
            this.label3.TabIndex = 6;
            this.label3.Text = "学员姓名:";
            // 
            // label10
            // 
            this.label10.AutoSize = true;
            this.label10.Font = new System.Drawing.Font("微软雅黑", 12.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
            this.label10.Location = new System.Drawing.Point(383, 53);
            this.label10.Name = "label10";
            this.label10.Size = new System.Drawing.Size(78, 24);
            this.label10.TabIndex = 10;
            this.label10.Text = "签订协议";
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label_jydq);
            this.groupBox2.Controls.Add(this.label_jynj);
            this.groupBox2.Controls.Add(this.label_jydh);
            this.groupBox2.Controls.Add(this.label_jyzy);
            this.groupBox2.Controls.Add(this.label_jyxm);
            this.groupBox2.Controls.Add(this.label8);
            this.groupBox2.Controls.Add(this.label9);
            this.groupBox2.Controls.Add(this.label11);
            this.groupBox2.Controls.Add(this.label12);
            this.groupBox2.Controls.Add(this.label13);
            this.groupBox2.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.groupBox2.Location = new System.Drawing.Point(609, 118);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(541, 111);
            this.groupBox2.TabIndex = 10;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "教员信息";
            // 
            // label_jydq
            // 
            this.label_jydq.AutoSize = true;
            this.label_jydq.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_jydq.ForeColor = System.Drawing.Color.Black;
            this.label_jydq.Location = new System.Drawing.Point(336, 51);
            this.label_jydq.Name = "label_jydq";
            this.label_jydq.Size = new System.Drawing.Size(0, 17);
            this.label_jydq.TabIndex = 20;
            // 
            // label_jynj
            // 
            this.label_jynj.AutoSize = true;
            this.label_jynj.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_jynj.ForeColor = System.Drawing.Color.Black;
            this.label_jynj.Location = new System.Drawing.Point(336, 24);
            this.label_jynj.Name = "label_jynj";
            this.label_jynj.Size = new System.Drawing.Size(0, 17);
            this.label_jynj.TabIndex = 19;
            // 
            // label_jydh
            // 
            this.label_jydh.AutoSize = true;
            this.label_jydh.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_jydh.ForeColor = System.Drawing.Color.Black;
            this.label_jydh.Location = new System.Drawing.Point(72, 78);
            this.label_jydh.Name = "label_jydh";
            this.label_jydh.Size = new System.Drawing.Size(0, 17);
            this.label_jydh.TabIndex = 18;
            // 
            // label_jyzy
            // 
            this.label_jyzy.AutoSize = true;
            this.label_jyzy.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_jyzy.ForeColor = System.Drawing.Color.Black;
            this.label_jyzy.Location = new System.Drawing.Point(72, 51);
            this.label_jyzy.Name = "label_jyzy";
            this.label_jyzy.Size = new System.Drawing.Size(0, 17);
            this.label_jyzy.TabIndex = 17;
            // 
            // label_jyxm
            // 
            this.label_jyxm.AutoSize = true;
            this.label_jyxm.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label_jyxm.ForeColor = System.Drawing.Color.Black;
            this.label_jyxm.Location = new System.Drawing.Point(72, 24);
            this.label_jyxm.Name = "label_jyxm";
            this.label_jyxm.Size = new System.Drawing.Size(0, 17);
            this.label_jyxm.TabIndex = 16;
            // 
            // label8
            // 
            this.label8.AutoSize = true;
            this.label8.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label8.ForeColor = System.Drawing.Color.Black;
            this.label8.Location = new System.Drawing.Point(271, 51);
            this.label8.Name = "label8";
            this.label8.Size = new System.Drawing.Size(59, 17);
            this.label8.TabIndex = 15;
            this.label8.Text = "所在地区:";
            // 
            // label9
            // 
            this.label9.AutoSize = true;
            this.label9.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label9.ForeColor = System.Drawing.Color.Black;
            this.label9.Location = new System.Drawing.Point(271, 24);
            this.label9.Name = "label9";
            this.label9.Size = new System.Drawing.Size(59, 17);
            this.label9.TabIndex = 14;
            this.label9.Text = "所教年级:";
            // 
            // label11
            // 
            this.label11.AutoSize = true;
            this.label11.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label11.ForeColor = System.Drawing.Color.Black;
            this.label11.Location = new System.Drawing.Point(7, 78);
            this.label11.Name = "label11";
            this.label11.Size = new System.Drawing.Size(59, 17);
            this.label11.TabIndex = 13;
            this.label11.Text = "联系电话:";
            // 
            // label12
            // 
            this.label12.AutoSize = true;
            this.label12.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label12.ForeColor = System.Drawing.Color.Black;
            this.label12.Location = new System.Drawing.Point(7, 51);
            this.label12.Name = "label12";
            this.label12.Size = new System.Drawing.Size(59, 17);
            this.label12.TabIndex = 12;
            this.label12.Text = "教员专业:";
            // 
            // label13
            // 
            this.label13.AutoSize = true;
            this.label13.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label13.ForeColor = System.Drawing.Color.Black;
            this.label13.Location = new System.Drawing.Point(7, 24);
            this.label13.Name = "label13";
            this.label13.Size = new System.Drawing.Size(59, 17);
            this.label13.TabIndex = 11;
            this.label13.Text = "教员姓名:";
            // 
            // groupBox3
            // 
            this.groupBox3.Controls.Add(this.uCkcb1);
            this.groupBox3.Location = new System.Drawing.Point(26, 235);
            this.groupBox3.Name = "groupBox3";
            this.groupBox3.Size = new System.Drawing.Size(1141, 239);
            this.groupBox3.TabIndex = 16;
            this.groupBox3.TabStop = false;
            this.groupBox3.Text = "课程表";
            // 
            // uCkcb1
            // 
            this.uCkcb1.Dock = System.Windows.Forms.DockStyle.Fill;
            this.uCkcb1.Location = new System.Drawing.Point(3, 17);
            this.uCkcb1.Name = "uCkcb1";
            this.uCkcb1.Size = new System.Drawing.Size(1135, 219);
            this.uCkcb1.TabIndex = 0;
            // 
            // label14
            // 
            this.label14.AutoSize = true;
            this.label14.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label14.ForeColor = System.Drawing.Color.Black;
            this.label14.Location = new System.Drawing.Point(31, 477);
            this.label14.Name = "label14";
            this.label14.Size = new System.Drawing.Size(59, 17);
            this.label14.TabIndex = 17;
            this.label14.Text = "上课地点:";
            // 
            // label15
            // 
            this.label15.AutoSize = true;
            this.label15.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label15.ForeColor = System.Drawing.Color.Black;
            this.label15.Location = new System.Drawing.Point(394, 541);
            this.label15.Name = "label15";
            this.label15.Size = new System.Drawing.Size(43, 17);
            this.label15.TabIndex = 18;
            this.label15.Text = "费  用:";
            // 
            // label16
            // 
            this.label16.AutoSize = true;
            this.label16.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label16.ForeColor = System.Drawing.Color.Black;
            this.label16.Location = new System.Drawing.Point(31, 508);
            this.label16.Name = "label16";
            this.label16.Size = new System.Drawing.Size(59, 17);
            this.label16.TabIndex = 19;
            this.label16.Text = "结算方式:";
            // 
            // label17
            // 
            this.label17.AutoSize = true;
            this.label17.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label17.ForeColor = System.Drawing.Color.Black;
            this.label17.Location = new System.Drawing.Point(281, 509);
            this.label17.Name = "label17";
            this.label17.Size = new System.Drawing.Size(59, 17);
            this.label17.TabIndex = 20;
            this.label17.Text = "开始时间:";
            // 
            // label18
            // 
            this.label18.AutoSize = true;
            this.label18.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label18.ForeColor = System.Drawing.Color.Black;
            this.label18.Location = new System.Drawing.Point(507, 508);
            this.label18.Name = "label18";
            this.label18.Size = new System.Drawing.Size(59, 17);
            this.label18.TabIndex = 21;
            this.label18.Text = "结束时间:";
            // 
            // label19
            // 
            this.label19.AutoSize = true;
            this.label19.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label19.ForeColor = System.Drawing.Color.Black;
            this.label19.Location = new System.Drawing.Point(712, 475);
            this.label19.Name = "label19";
            this.label19.Size = new System.Drawing.Size(43, 17);
            this.label19.TabIndex = 22;
            this.label19.Text = "备  注:";
            // 
            // txt_bz
            // 
            this.txt_bz.Location = new System.Drawing.Point(715, 498);
            this.txt_bz.Name = "txt_bz";
            this.txt_bz.Size = new System.Drawing.Size(449, 60);
            this.txt_bz.TabIndex = 11;
            this.txt_bz.Text = "";
            // 
            // dateTimePicker_ks
            // 
            this.dateTimePicker_ks.Location = new System.Drawing.Point(348, 507);
            this.dateTimePicker_ks.Name = "dateTimePicker_ks";
            this.dateTimePicker_ks.Size = new System.Drawing.Size(127, 21);
            this.dateTimePicker_ks.TabIndex = 5;
            // 
            // dateTimePicker_js
            // 
            this.dateTimePicker_js.Location = new System.Drawing.Point(568, 506);
            this.dateTimePicker_js.Name = "dateTimePicker_js";
            this.dateTimePicker_js.Size = new System.Drawing.Size(125, 21);
            this.dateTimePicker_js.TabIndex = 6;
            // 
            // txt_skdd
            // 
            this.txt_skdd.Location = new System.Drawing.Point(96, 475);
            this.txt_skdd.Name = "txt_skdd";
            this.txt_skdd.Size = new System.Drawing.Size(412, 21);
            this.txt_skdd.TabIndex = 2;
            // 
            // txt_ymks
            // 
            this.txt_ymks.Location = new System.Drawing.Point(438, 539);
            this.txt_ymks.Name = "txt_ymks";
            this.txt_ymks.Size = new System.Drawing.Size(70, 21);
            this.txt_ymks.TabIndex = 9;
            // 
            // label20
            // 
            this.label20.AutoSize = true;
            this.label20.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label20.ForeColor = System.Drawing.Color.Black;
            this.label20.Location = new System.Drawing.Point(511, 541);
            this.label20.Name = "label20";
            this.label20.Size = new System.Drawing.Size(49, 17);
            this.label20.TabIndex = 28;
            this.label20.Text = "元/课时";
            // 
            // groupBox_jsfs
            // 
            this.groupBox_jsfs.Controls.Add(this.rbtn_y);
            this.groupBox_jsfs.Controls.Add(this.rbtn_t);
            this.groupBox_jsfs.Controls.Add(this.rbtn_ks);
            this.groupBox_jsfs.Location = new System.Drawing.Point(96, 498);
            this.groupBox_jsfs.Name = "groupBox_jsfs";
            this.groupBox_jsfs.Size = new System.Drawing.Size(160, 31);
            this.groupBox_jsfs.TabIndex = 31;
            this.groupBox_jsfs.TabStop = false;
            // 
            // rbtn_y
            // 
            this.rbtn_y.AutoSize = true;
            this.rbtn_y.Location = new System.Drawing.Point(106, 11);
            this.rbtn_y.Name = "rbtn_y";
            this.rbtn_y.Size = new System.Drawing.Size(35, 16);
            this.rbtn_y.TabIndex = 2;
            this.rbtn_y.Text = "月";
            this.rbtn_y.UseVisualStyleBackColor = true;
            // 
            // rbtn_t
            // 
            this.rbtn_t.AutoSize = true;
            this.rbtn_t.Location = new System.Drawing.Point(60, 11);
            this.rbtn_t.Name = "rbtn_t";
            this.rbtn_t.Size = new System.Drawing.Size(35, 16);
            this.rbtn_t.TabIndex = 1;
            this.rbtn_t.Text = "天";
            this.rbtn_t.UseVisualStyleBackColor = true;
            // 
            // rbtn_ks
            // 
            this.rbtn_ks.AutoSize = true;
            this.rbtn_ks.Checked = true;
            this.rbtn_ks.Location = new System.Drawing.Point(7, 11);
            this.rbtn_ks.Name = "rbtn_ks";
            this.rbtn_ks.Size = new System.Drawing.Size(47, 16);
            this.rbtn_ks.TabIndex = 4;
            this.rbtn_ks.TabStop = true;
            this.rbtn_ks.Text = "课时";
            this.rbtn_ks.UseVisualStyleBackColor = true;
            // 
            // label21
            // 
            this.label21.AutoSize = true;
            this.label21.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label21.ForeColor = System.Drawing.Color.Black;
            this.label21.Location = new System.Drawing.Point(191, 541);
            this.label21.Name = "label21";
            this.label21.Size = new System.Drawing.Size(32, 17);
            this.label21.TabIndex = 32;
            this.label21.Text = "课时";
            // 
            // txt_zks
            // 
            this.txt_zks.Location = new System.Drawing.Point(96, 539);
            this.txt_zks.Name = "txt_zks";
            this.txt_zks.Size = new System.Drawing.Size(95, 21);
            this.txt_zks.TabIndex = 7;
            // 
            // txt_zwh
            // 
            this.txt_zwh.Location = new System.Drawing.Point(286, 539);
            this.txt_zwh.Name = "txt_zwh";
            this.txt_zwh.Size = new System.Drawing.Size(88, 21);
            this.txt_zwh.TabIndex = 8;
            // 
            // label24
            // 
            this.label24.AutoSize = true;
            this.label24.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label24.ForeColor = System.Drawing.Color.Black;
            this.label24.Location = new System.Drawing.Point(35, 541);
            this.label24.Name = "label24";
            this.label24.Size = new System.Drawing.Size(55, 17);
            this.label24.TabIndex = 34;
            this.label24.Text = "总 课 时:";
            // 
            // label25
            // 
            this.label25.AutoSize = true;
            this.label25.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label25.ForeColor = System.Drawing.Color.Black;
            this.label25.Location = new System.Drawing.Point(238, 541);
            this.label25.Name = "label25";
            this.label25.Size = new System.Drawing.Size(47, 17);
            this.label25.TabIndex = 33;
            this.label25.Text = "座位号:";
            // 
            // label22
            // 
            this.label22.AutoSize = true;
            this.label22.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label22.ForeColor = System.Drawing.Color.Black;
            this.label22.Location = new System.Drawing.Point(635, 541);
            this.label22.Name = "label22";
            this.label22.Size = new System.Drawing.Size(61, 17);
            this.label22.TabIndex = 38;
            this.label22.Text = "分钟/课时";
            // 
            // txt_fzmxs
            // 
            this.txt_fzmxs.Location = new System.Drawing.Point(566, 539);
            this.txt_fzmxs.Name = "txt_fzmxs";
            this.txt_fzmxs.Size = new System.Drawing.Size(70, 21);
            this.txt_fzmxs.TabIndex = 10;
            // 
            // label23
            // 
            this.label23.AutoSize = true;
            this.label23.Font = new System.Drawing.Font("微软雅黑", 9F);
            this.label23.ForeColor = System.Drawing.Color.Black;
            this.label23.Location = new System.Drawing.Point(517, 477);
            this.label23.Name = "label23";
            this.label23.Size = new System.Drawing.Size(43, 17);
            this.label23.TabIndex = 39;
            this.label23.Text = "科 目 :";
            // 
            // txt_km
            // 
            this.txt_km.Location = new System.Drawing.Point(568, 475);
            this.txt_km.Name = "txt_km";
            this.txt_km.Size = new System.Drawing.Size(125, 21);
            this.txt_km.TabIndex = 3;
            // 
            // FrmQdxy
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
            this.ClientSize = new System.Drawing.Size(1174, 573);
            this.Controls.Add(this.txt_km);
            this.Controls.Add(this.label23);
            this.Controls.Add(this.label22);
            this.Controls.Add(this.txt_fzmxs);
            this.Controls.Add(this.txt_zks);
            this.Controls.Add(this.txt_zwh);
            this.Controls.Add(this.label24);
            this.Controls.Add(this.label25);
            this.Controls.Add(this.label21);
            this.Controls.Add(this.groupBox_jsfs);
            this.Controls.Add(this.label20);
            this.Controls.Add(this.txt_ymks);
            this.Controls.Add(this.txt_skdd);
            this.Controls.Add(this.dateTimePicker_js);
            this.Controls.Add(this.dateTimePicker_ks);
            this.Controls.Add(this.txt_bz);
            this.Controls.Add(this.label19);
            this.Controls.Add(this.label18);
            this.Controls.Add(this.label17);
            this.Controls.Add(this.label16);
            this.Controls.Add(this.label15);
            this.Controls.Add(this.label14);
            this.Controls.Add(this.groupBox3);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.label10);
            this.Controls.Add(this.groupBox1);
            this.Controls.Add(this.txt_jyno);
            this.Controls.Add(this.txt_xyno);
            this.Controls.Add(this.label1);
            this.Controls.Add(this.label2);
            this.ImeMode = System.Windows.Forms.ImeMode.OnHalf;
            this.Name = "FrmQdxy";
            this.Text = "签订协议";
            this.Controls.SetChildIndex(this.label2, 0);
            this.Controls.SetChildIndex(this.label1, 0);
            this.Controls.SetChildIndex(this.txt_xyno, 0);
            this.Controls.SetChildIndex(this.txt_jyno, 0);
            this.Controls.SetChildIndex(this.groupBox1, 0);
            this.Controls.SetChildIndex(this.label10, 0);
            this.Controls.SetChildIndex(this.groupBox2, 0);
            this.Controls.SetChildIndex(this.groupBox3, 0);
            this.Controls.SetChildIndex(this.label14, 0);
            this.Controls.SetChildIndex(this.label15, 0);
            this.Controls.SetChildIndex(this.label16, 0);
            this.Controls.SetChildIndex(this.label17, 0);
            this.Controls.SetChildIndex(this.label18, 0);
            this.Controls.SetChildIndex(this.label19, 0);
            this.Controls.SetChildIndex(this.txt_bz, 0);
            this.Controls.SetChildIndex(this.dateTimePicker_ks, 0);
            this.Controls.SetChildIndex(this.dateTimePicker_js, 0);
            this.Controls.SetChildIndex(this.txt_skdd, 0);
            this.Controls.SetChildIndex(this.txt_ymks, 0);
            this.Controls.SetChildIndex(this.label20, 0);
            this.Controls.SetChildIndex(this.groupBox_jsfs, 0);
            this.Controls.SetChildIndex(this.label21, 0);
            this.Controls.SetChildIndex(this.label25, 0);
            this.Controls.SetChildIndex(this.label24, 0);
            this.Controls.SetChildIndex(this.txt_zwh, 0);
            this.Controls.SetChildIndex(this.txt_zks, 0);
            this.Controls.SetChildIndex(this.txt_fzmxs, 0);
            this.Controls.SetChildIndex(this.label22, 0);
            this.Controls.SetChildIndex(this.label23, 0);
            this.Controls.SetChildIndex(this.txt_km, 0);
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.groupBox3.ResumeLayout(false);
            this.groupBox_jsfs.ResumeLayout(false);
            this.groupBox_jsfs.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        public override void tsb_save_fun()
        {
            this.xydao.Add(this.CollectData());
            MessageBox.Show("保存成功!");
            base.Close();
        }

        private void txt_jyno_Click(object sender, EventArgs e)
        {
            this.frmtecitem = new FrmTecItem(null,null);
            this.frmtecitem.selectedOK += new FrmControlBase.SelectedItem(this.frmtecitem_selectedOK);
            this.frmtecitem.ShowDialog();
        }

        private void txt_jyno_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar == '\r') && (this.frmstuintem == null))
            {
                this.frmtecitem = new FrmTecItem(this.txt_jyno.Text,null);
                this.frmtecitem.selectedOK += new FrmControlBase.SelectedItem(this.frmtecitem_selectedOK);
                this.frmtecitem.ShowDialog();
            }
            else if ((e.KeyChar == '\r') && (this.frmstuintem != null))
            {
                this.frmtecitem.ShowData(this.txt_jyno.Text,null);
                this.frmtecitem.ShowDialog();
            }
        }

        private void txt_skdd_Click(object sender, EventArgs e)
        {
            this.frmdepitem = new FrmDepitem(null);
            this.frmdepitem.selectedOK += new FrmControlBase.SelectedItem(this.frmdepitem_selectedOK);
            this.frmdepitem.ShowDialog();
        }

        private void txt_xyno_Click(object sender, EventArgs e)
        {
            this.frmstuintem = new FrmStuItem();
            this.frmstuintem.selectedOK += new FrmControlBase.SelectedItem(this.frmstuintem_selectedOK);
            this.frmstuintem.ShowDialog();
        }

        private void txt_xyno_KeyPress(object sender, KeyPressEventArgs e)
        {
            if ((e.KeyChar == '\r') && (this.frmstuintem == null))
            {
                this.frmstuintem = new FrmStuItem(null,this.txt_xyno.Text);
                this.frmstuintem.selectedOK += new FrmControlBase.SelectedItem(this.frmstuintem_selectedOK);
                this.frmstuintem.ShowDialog();
            }
            else if ((e.KeyChar == '\r') && (this.frmstuintem != null))
            {
                this.frmstuintem.ShowData(this.txt_xyno.Text,null);
                this.frmstuintem.ShowDialog();
            }
        }
    }

 

}
